Update Chat Files
Creates, updates, or deletes files for a chat. Pass null to delete. This requires the chat's preview to be running.
Usage
import { v0 } from 'v0-sdk'const result = await v0.chats.updateFiles({ chatId: 'chat_abc123', files: 'example',})console.log(result)API Signature
Request
Path Parameters
The unique identifier of the chat.
Request Body
The files to create, update, or delete. Each path must be unique.
Project-relative file path, e.g. "app/page.tsx".
New file content. Pass null to delete the file at this path.
Response
The user and assistant messages created by the edit, in chronological order.
Unique message identifier.
ID of the chat this message belongs to.
Who produced this message.
ISO timestamp when the message was created.
ISO timestamp when the message was last updated.
The trailing prose of the message — the agent’s closing summary, or the user’s message text. Empty string when there is no closing prose.
Ordered list of parts that make up the message. Iterate to render the full narrative including thinking, file operations, tool calls, and prose.
A block of text output by the agent.
Markdown prose written by the agent or user.
ISO timestamp when this part began.
ISO timestamp when this part completed.
Why generation ended. Null while the agent is still generating; once non-null, the message is final and safe to consume.
Files attached to this message.
URL to the attachment.
Original filename, when available.
MIME type.
Size in bytes.
ID of the user who authored a user message; null for assistant messages.
Token usage and credit cost. All values are zero on user messages and on assistant messages that have not yet generated tokens.
Token counts for this message.
Prompt input value (non-cached).
Completion output value.
Cache-read input value.
Cache-write input value.
Sum of input, output, cacheRead, and cacheWrite.
Credit cost for this message.
Prompt input value (non-cached).
Completion output value.
Cache-read input value.
Cache-write input value.
Sum of input, output, cacheRead, and cacheWrite.